package com.netease.videoLoaderDemo.service;


import android.os.Build;

import com.netease.videoLoaderDemo.SpriteImageHelper;
import com.netease.videoLoaderDemo.SpriteImageInfo;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.function.Consumer;

public class MockItemImpl implements MockItemInterface {
    private List<String> kMockVideoInfoIds = Arrays.asList("1000001", "1000002", "1000003", "1000004", "1000005", "1000006", "1000007", "1000008", "1000009", "1000010"
            , "1000011", "1000012", "1000013", "1000014", "1000015", "1000016", "1000017", "1000018", "1000019", "1000020");
//    private List<String> urlList = Arrays.asList("http://jdvodzopqjhvv.vod.126.net/jdvodzopqjhvv/a5977679-4bd6-4c32-a32d-b444fc2c3283.mp4",
//            "http://jdvodzopqjhvv.vod.126.net/jdvodzopqjhvv/2f65ddc9-c46a-43fb-a8ef-41e9bc5fa688.mp4",
//            "https://vodegkofxdv.vod.126.net/vodegkofxdv/pquGvpyd_1677633965_shd.mp4",
//            "http://jdvodoi9j5ej8.vod.126.net/jdvodoi9j5ej8/music.mp4",
//            "http://jdvodzopqjhvv.vod.126.net/jdvodzopqjhvv/a5977679-4bd6-4c32-a32d-b444fc2c3283.mp4",
//            "http://jdvodzopqjhvv.vod.126.net/jdvodzopqjhvv/2f65ddc9-c46a-43fb-a8ef-41e9bc5fa688.mp4",
//            "https://vodegkofxdv.vod.126.net/vodegkofxdv/pquGvpyd_1677633965_shd.mp4",
//            "http://jdvodoi9j5ej8.vod.126.net/jdvodoi9j5ej8/music.mp4",
//            "http://jdvodzopqjhvv.vod.126.net/jdvodzopqjhvv/a5977679-4bd6-4c32-a32d-b444fc2c3283.mp4",
//            "http://jdvodzopqjhvv.vod.126.net/jdvodzopqjhvv/2f65ddc9-c46a-43fb-a8ef-41e9bc5fa688.mp4",
//            "https://vodegkofxdv.vod.126.net/vodegkofxdv/pquGvpyd_1677633965_shd.mp4",
//            "http://jdvodoi9j5ej8.vod.126.net/jdvodoi9j5ej8/music.mp4",
//            "http://jdvodzopqjhvv.vod.126.net/jdvodzopqjhvv/a5977679-4bd6-4c32-a32d-b444fc2c3283.mp4",
//            "http://jdvodzopqjhvv.vod.126.net/jdvodzopqjhvv/2f65ddc9-c46a-43fb-a8ef-41e9bc5fa688.mp4",
//            "https://vodegkofxdv.vod.126.net/vodegkofxdv/pquGvpyd_1677633965_shd.mp4",
//            "http://jdvodoi9j5ej8.vod.126.net/jdvodoi9j5ej8/music.mp4",
//            "http://jdvodzopqjhvv.vod.126.net/jdvodzopqjhvv/a5977679-4bd6-4c32-a32d-b444fc2c3283.mp4",
//            "http://jdvodzopqjhvv.vod.126.net/jdvodzopqjhvv/2f65ddc9-c46a-43fb-a8ef-41e9bc5fa688.mp4",
//            "https://vodegkofxdv.vod.126.net/vodegkofxdv/pquGvpyd_1677633965_shd.mp4",
//            "http://jdvodoi9j5ej8.vod.126.net/jdvodoi9j5ej8/music.mp4");
    private List<ArrayList<String>> urlList =  Arrays.asList(
        new ArrayList<>(Arrays.asList("http://jdvodqgrk3qx4.vod.126.net/jdvodqgrk3qx4/TaRfWcKH_9312617348_shd.m3u8", "rtmp://ve2618856.live.126.net/live/cdb8aa85e7774185bdb5a9fe5aac322d_S1", "rtmp://ve2618856.live.126.net/live/cdb8aa85e7774185bdb5a9fe5aac322d_S3", "rtmp://ve2618856.live.126.net/live/cdb8aa85e7774185bdb5a9fe5aac322d_S2")),
        new ArrayList<>(Arrays.asList("http://jdvodqgrk3qx4.vod.126.net/jdvodqgrk3qx4/naDoveQG_9312618052_shd.m3u8", "rtmp://ve2618856.live.126.net/live/4393b9a5f8bc46c591a8faab930366c9_S1", "rtmp://ve2618856.live.126.net/live/4393b9a5f8bc46c591a8faab930366c9_S3", "rtmp://ve2618856.live.126.net/live/4393b9a5f8bc46c591a8faab930366c9_S2")),
        new ArrayList<>(Arrays.asList("http://jdvodqgrk3qx4.vod.126.net/jdvodqgrk3qx4/wyJF9LDp_9312620332_shd.m3u8", "rtmp://ve2618856.live.126.net/live/cab88138190142c3907610b49f8bdcf3_S1", "rtmp://ve2618856.live.126.net/live/cab88138190142c3907610b49f8bdcf3_S3", "rtmp://ve2618856.live.126.net/live/cab88138190142c3907610b49f8bdcf3_S2")),
        new ArrayList<>(Arrays.asList("http://jdvodqgrk3qx4.vod.126.net/jdvodqgrk3qx4/VuqHp4oY_9312592118_shd.m3u8", "rtmp://ve2618856.live.126.net/live/f32b3c1fbfaa4acc8f0302e4ab272059_S1", "rtmp://ve2618856.live.126.net/live/f32b3c1fbfaa4acc8f0302e4ab272059_S3", "rtmp://ve2618856.live.126.net/live/f32b3c1fbfaa4acc8f0302e4ab272059_S2")),
        new ArrayList<>(Arrays.asList("http://jdvodqgrk3qx4.vod.126.net/jdvodqgrk3qx4/UXg9k4tf_9312622976_shd.m3u8", "rtmp://ve2618856.live.126.net/live/a18bc2ca0df64abd86e78701d1e91557_S1", "rtmp://ve2618856.live.126.net/live/a18bc2ca0df64abd86e78701d1e91557_S3", "rtmp://ve2618856.live.126.net/live/a18bc2ca0df64abd86e78701d1e91557_S2")),
        new ArrayList<>(Arrays.asList("http://jdvodqgrk3qx4.vod.126.net/jdvodqgrk3qx4/1FlRtmoI_9312624739_shd.m3u8", "rtmp://ve2618856.live.126.net/live/f76c9e0bd38242bca8ca1fc636ceee79_S1", "rtmp://ve2618856.live.126.net/live/f76c9e0bd38242bca8ca1fc636ceee79_S3", "rtmp://ve2618856.live.126.net/live/f76c9e0bd38242bca8ca1fc636ceee79_S2")),
        new ArrayList<>(Arrays.asList("http://jdvodqgrk3qx4.vod.126.net/jdvodqgrk3qx4/TaRfWcKH_9312617348_shd.m3u8", "rtmp://ve2618856.live.126.net/live/cdb8aa85e7774185bdb5a9fe5aac322d_S1", "rtmp://ve2618856.live.126.net/live/cdb8aa85e7774185bdb5a9fe5aac322d_S3", "rtmp://ve2618856.live.126.net/live/cdb8aa85e7774185bdb5a9fe5aac322d_S2")),
        new ArrayList<>(Arrays.asList("http://jdvodqgrk3qx4.vod.126.net/jdvodqgrk3qx4/naDoveQG_9312618052_shd.m3u8", "rtmp://ve2618856.live.126.net/live/4393b9a5f8bc46c591a8faab930366c9_S1", "rtmp://ve2618856.live.126.net/live/4393b9a5f8bc46c591a8faab930366c9_S3", "rtmp://ve2618856.live.126.net/live/4393b9a5f8bc46c591a8faab930366c9_S2")),
        new ArrayList<>(Arrays.asList("http://jdvodqgrk3qx4.vod.126.net/jdvodqgrk3qx4/wyJF9LDp_9312620332_shd.m3u8", "rtmp://ve2618856.live.126.net/live/cab88138190142c3907610b49f8bdcf3_S1", "rtmp://ve2618856.live.126.net/live/cab88138190142c3907610b49f8bdcf3_S3", "rtmp://ve2618856.live.126.net/live/cab88138190142c3907610b49f8bdcf3_S2")),
        new ArrayList<>(Arrays.asList("http://jdvodqgrk3qx4.vod.126.net/jdvodqgrk3qx4/VuqHp4oY_9312592118_shd.m3u8", "rtmp://ve2618856.live.126.net/live/f32b3c1fbfaa4acc8f0302e4ab272059_S1", "rtmp://ve2618856.live.126.net/live/f32b3c1fbfaa4acc8f0302e4ab272059_S3", "rtmp://ve2618856.live.126.net/live/f32b3c1fbfaa4acc8f0302e4ab272059_S2")),
        new ArrayList<>(Arrays.asList("http://jdvodqgrk3qx4.vod.126.net/jdvodqgrk3qx4/UXg9k4tf_9312622976_shd.m3u8", "rtmp://ve2618856.live.126.net/live/a18bc2ca0df64abd86e78701d1e91557_S1", "rtmp://ve2618856.live.126.net/live/a18bc2ca0df64abd86e78701d1e91557_S3", "rtmp://ve2618856.live.126.net/live/a18bc2ca0df64abd86e78701d1e91557_S2")),
        new ArrayList<>(Arrays.asList("http://jdvodqgrk3qx4.vod.126.net/jdvodqgrk3qx4/1FlRtmoI_9312624739_shd.m3u8", "rtmp://ve2618856.live.126.net/live/f76c9e0bd38242bca8ca1fc636ceee79_S1", "rtmp://ve2618856.live.126.net/live/f76c9e0bd38242bca8ca1fc636ceee79_S3", "rtmp://ve2618856.live.126.net/live/f76c9e0bd38242bca8ca1fc636ceee79_S2")),
        new ArrayList<>(Arrays.asList("http://jdvodqgrk3qx4.vod.126.net/jdvodqgrk3qx4/TaRfWcKH_9312617348_shd.m3u8", "rtmp://ve2618856.live.126.net/live/cdb8aa85e7774185bdb5a9fe5aac322d_S1", "rtmp://ve2618856.live.126.net/live/cdb8aa85e7774185bdb5a9fe5aac322d_S3", "rtmp://ve2618856.live.126.net/live/cdb8aa85e7774185bdb5a9fe5aac322d_S2")),
        new ArrayList<>(Arrays.asList("http://jdvodqgrk3qx4.vod.126.net/jdvodqgrk3qx4/naDoveQG_9312618052_shd.m3u8", "rtmp://ve2618856.live.126.net/live/4393b9a5f8bc46c591a8faab930366c9_S1", "rtmp://ve2618856.live.126.net/live/4393b9a5f8bc46c591a8faab930366c9_S3", "rtmp://ve2618856.live.126.net/live/4393b9a5f8bc46c591a8faab930366c9_S2")),
        new ArrayList<>(Arrays.asList("http://jdvodqgrk3qx4.vod.126.net/jdvodqgrk3qx4/wyJF9LDp_9312620332_shd.m3u8", "rtmp://ve2618856.live.126.net/live/cab88138190142c3907610b49f8bdcf3_S1", "rtmp://ve2618856.live.126.net/live/cab88138190142c3907610b49f8bdcf3_S3", "rtmp://ve2618856.live.126.net/live/cab88138190142c3907610b49f8bdcf3_S2")),
        new ArrayList<>(Arrays.asList("http://jdvodqgrk3qx4.vod.126.net/jdvodqgrk3qx4/VuqHp4oY_9312592118_shd.m3u8", "rtmp://ve2618856.live.126.net/live/f32b3c1fbfaa4acc8f0302e4ab272059_S1", "rtmp://ve2618856.live.126.net/live/f32b3c1fbfaa4acc8f0302e4ab272059_S3", "rtmp://ve2618856.live.126.net/live/f32b3c1fbfaa4acc8f0302e4ab272059_S2")),
        new ArrayList<>(Arrays.asList("http://jdvodqgrk3qx4.vod.126.net/jdvodqgrk3qx4/UXg9k4tf_9312622976_shd.m3u8", "rtmp://ve2618856.live.126.net/live/a18bc2ca0df64abd86e78701d1e91557_S1", "rtmp://ve2618856.live.126.net/live/a18bc2ca0df64abd86e78701d1e91557_S3", "rtmp://ve2618856.live.126.net/live/a18bc2ca0df64abd86e78701d1e91557_S2")),
        new ArrayList<>(Arrays.asList("http://jdvodqgrk3qx4.vod.126.net/jdvodqgrk3qx4/1FlRtmoI_9312624739_shd.m3u8", "rtmp://ve2618856.live.126.net/live/f76c9e0bd38242bca8ca1fc636ceee79_S1", "rtmp://ve2618856.live.126.net/live/f76c9e0bd38242bca8ca1fc636ceee79_S3", "rtmp://ve2618856.live.126.net/live/f76c9e0bd38242bca8ca1fc636ceee79_S2")),
        new ArrayList<>(Arrays.asList("http://jdvodqgrk3qx4.vod.126.net/jdvodqgrk3qx4/TaRfWcKH_9312617348_shd.m3u8", "rtmp://ve2618856.live.126.net/live/cdb8aa85e7774185bdb5a9fe5aac322d_S1", "rtmp://ve2618856.live.126.net/live/cdb8aa85e7774185bdb5a9fe5aac322d_S3", "rtmp://ve2618856.live.126.net/live/cdb8aa85e7774185bdb5a9fe5aac322d_S2")),
        new ArrayList<>(Arrays.asList("http://jdvodqgrk3qx4.vod.126.net/jdvodqgrk3qx4/naDoveQG_9312618052_shd.m3u8", "rtmp://ve2618856.live.126.net/live/4393b9a5f8bc46c591a8faab930366c9_S1", "rtmp://ve2618856.live.126.net/live/4393b9a5f8bc46c591a8faab930366c9_S3", "rtmp://ve2618856.live.126.net/live/4393b9a5f8bc46c591a8faab930366c9_S2"))
    );

    private static List<SpriteImageInfo> spriteList = Arrays.asList(
        new SpriteImageInfo(1200, 1278,6, 10,1, new ArrayList<>(Arrays.asList("http://jdvodfpcchcsf.nosdn.127.net/c55b8d7a-9290-4d47-a4f4-85c6aa719b40-1.jpg",
                "http://jdvodfpcchcsf.nosdn.127.net/c55b8d7a-9290-4d47-a4f4-85c6aa719b40-2.jpg","http://jdvodfpcchcsf.nosdn.127.net/c55b8d7a-9290-4d47-a4f4-85c6aa719b40-3.jpg"))),
            new SpriteImageInfo(0, 0,0, 0,0, new ArrayList<>()),
            new SpriteImageInfo(0, 0,0, 0,0, new ArrayList<>()),
            new SpriteImageInfo(0, 0,0, 0,0, new ArrayList<>()),
            new SpriteImageInfo(0, 0,0, 0,0, new ArrayList<>()),
            new SpriteImageInfo(0, 0,0, 0,0, new ArrayList<>()),
            new SpriteImageInfo(1200, 1278,6, 10,1, new ArrayList<>(Arrays.asList("http://jdvodfpcchcsf.nosdn.127.net/c55b8d7a-9290-4d47-a4f4-85c6aa719b40-1.jpg",
                    "http://jdvodfpcchcsf.nosdn.127.net/c55b8d7a-9290-4d47-a4f4-85c6aa719b40-2.jpg","http://jdvodfpcchcsf.nosdn.127.net/c55b8d7a-9290-4d47-a4f4-85c6aa719b40-3.jpg"))),
            new SpriteImageInfo(0, 0,0, 0,0, new ArrayList<>()),
            new SpriteImageInfo(0, 0,0, 0,0, new ArrayList<>()),
            new SpriteImageInfo(0, 0,0, 0,0, new ArrayList<>()),
            new SpriteImageInfo(0, 0,0, 0,0, new ArrayList<>()),
            new SpriteImageInfo(0, 0,0, 0,0, new ArrayList<>()),
            new SpriteImageInfo(1200, 1278,6, 10,1, new ArrayList<>(Arrays.asList("http://jdvodfpcchcsf.nosdn.127.net/c55b8d7a-9290-4d47-a4f4-85c6aa719b40-1.jpg",
                    "http://jdvodfpcchcsf.nosdn.127.net/c55b8d7a-9290-4d47-a4f4-85c6aa719b40-2.jpg","http://jdvodfpcchcsf.nosdn.127.net/c55b8d7a-9290-4d47-a4f4-85c6aa719b40-3.jpg"))),
            new SpriteImageInfo(0, 0,0, 0,0, new ArrayList<>()),
            new SpriteImageInfo(0, 0,0, 0,0, new ArrayList<>()),
            new SpriteImageInfo(0, 0,0, 0,0, new ArrayList<>()),
            new SpriteImageInfo(0, 0,0, 0,0, new ArrayList<>()),
            new SpriteImageInfo(0, 0,0, 0,0, new ArrayList<>()),
            new SpriteImageInfo(1200, 1278,6, 10,1, new ArrayList<>(Arrays.asList("http://jdvodfpcchcsf.nosdn.127.net/c55b8d7a-9290-4d47-a4f4-85c6aa719b40-1.jpg",
                    "http://jdvodfpcchcsf.nosdn.127.net/c55b8d7a-9290-4d47-a4f4-85c6aa719b40-2.jpg","http://jdvodfpcchcsf.nosdn.127.net/c55b8d7a-9290-4d47-a4f4-85c6aa719b40-3.jpg"))),
            new SpriteImageInfo(0, 0,0, 0,0, new ArrayList<>())
    );



    @Override
    public void getRoomList(Consumer<List<VideoInfo>> success, Consumer<List<SpriteImageInfo>> success2, Consumer<Exception> error) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
            success.accept(getVideoInfoList());
            success2.accept(getSpriteImageInfoList());
        }
    }

    private List<VideoInfo> getVideoInfoList() {
        ArrayList<VideoInfo> retList = new ArrayList<>();
        List<String> mockVideoIds = kMockVideoInfoIds;
        for(int i = 0;i < mockVideoIds.size();i++){
            VideoInfo videoInfo = new VideoInfo();
            videoInfo.vId = mockVideoIds.get(i);
            videoInfo.vName = "video" + i;
            videoInfo.url = urlList.get(i);
            retList.add(videoInfo);
        }
        return retList;
    }
    private List<SpriteImageInfo> getSpriteImageInfoList() {
        ArrayList<SpriteImageInfo> retList = new ArrayList<>();
        for(int i = 0;i < spriteList.size();i++){
            retList.add(spriteList.get(i));
        }
        return retList;
    }
}
